package com.swak.stream;

import java.util.List;
import java.util.stream.Stream;

import com.swak.utils.Lists;

public class Streams {

	public static void main(String[] args) {
		Stream.iterate(0, t -> t + 1).limit(2).forEach(t -> {
			System.out.println(t);
		});
		System.out.println("++++++++++++++++++++");
		List<String> list = Lists.newArrayList("1", "2", "3");
		System.out.println(list.stream().filter(s -> s.equals("2")).findFirst().get());
		System.out.println(list.stream().filter(s -> s.equals("5")).findFirst().isPresent());
	}
}
